import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import notFind from './components/notfind.vue'
import Login from './views/login/index.vue' // 登录
import channelProviderList from './views/channelProvider/list.vue' // 商户管理
import NewChannel from './views/channelProvider/newChannel.vue' // 新增/编辑商户
import ChannelDetail from './views/channelProvider/channelDetail.vue' // 商户详情
import MerchantManagement from './views/merchantManagement/list.vue' // 商户人员管理
import NewMerchant from './views/merchantManagement/newMerchant.vue' // 新增/编辑商户人员
import DistributionAgencies from './views/distributionAgencies/list.vue' // 分销机构管理
import NewAgencies from './views/distributionAgencies/newAgencies.vue' // 新增分销机构
import DistributionManagement from './views/distributionManagement/list.vue' // 分销机构人员管理
import NewDistributionManage from './views/distributionManagement/newDistributionManage.vue' // 新增分销机构人员
import UploadJs from './views/uploadJs/index.vue'
import V10AsyncList from './views/report/list.vue'
import CusPreHistoryList from './views/report/listHistory.vue'
import CusPreNormalList from './views/report/listNormal.vue'
import ApiLog from './views/system/apiLogList.vue' // 日志管理
import SMSHistorySummary from './views/system/smsHistorySummaryList.vue' // 短信发送统计
import SMSHistoryFailure from './views/system/smsHistoryFailureList.vue' // 短信失败记录
import PremisesList from './views/premises/premisesList.vue' // 楼盘列表
import DynamicList from './views/premises/dynamicList.vue' //动态列表
import WxMsgFailure from './views/system/wxMsgFailureList' //微信失败消息记录

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '*',
      name: 'notFind',
      component: notFind,
    },
    {
      path: '/',
      name: 'login',
      component: Login,
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: '/channelProvider',
          name: 'channelProvider',
          component: channelProviderList,
        },
        {
          path: '/channelProvideradd',
          name: 'newChannel',
          component: NewChannel,
        },
        {
          path: '/channelProviderupdate',
          name: 'ChannelProviderupdate',
          component: NewChannel,
        },
        {
          path: '/channelProviderdetail',
          name: 'channelDetail',
          component: ChannelDetail,
        },
        {
          path: '/channelProviderdetail',
          name: 'channelDetail',
          component: ChannelDetail,
        },
        {
          path: '/merchantManagement',
          name: 'merchantManagement',
          component: MerchantManagement,
        },
        {
          path: '/newMerchant',
          name: 'NewMerchant',
          component: NewMerchant,
        },
        {
          path: '/updateMerchant',
          name: 'UpdateMerchant',
          component: NewMerchant,
        },
        {
          path: '/distributionAgencies',
          name: 'DistributionAgencies',
          component: DistributionAgencies,
        },
        {
          path: '/distributionManagement',
          name: 'DistributionManagement',
          component: DistributionManagement,
        },
        {
          path: '/newAgencies',
          name: 'NewAgencies',
          component: NewAgencies,
        },
        {
          path: '/updateAgencies',
          name: 'UpdateAgencies',
          component: NewAgencies,
        },
        {
          path: '/newDistributionManage',
          name: 'NewDistributionManage',
          component: NewDistributionManage,
        },
        {
          path: '/updateDistributionManage',
          name: 'UpdateDistributionManage',
          component: NewDistributionManage,
        },
        {
          path: '/uploadJs',
          name: 'UploadJs',
          component: UploadJs,
        },
        {
          path: '/v10AsyncList',
          name: 'V10AsyncList',
          component: V10AsyncList
        },
        {
          path: '/vusPreHistoryList',
          name: 'CusPreHistoryList',
          component: CusPreHistoryList
        },
        {
          path: '/vusPreNormalList',
          name: 'CusPreNormalList',
          component: CusPreNormalList
        },
        {
          path: '/apiLog',
          name: 'ApiLog',
          component: ApiLog
        },
        {
          path: '/smsHistorySummary',
          name: 'SMSHistorySummary',
          component: SMSHistorySummary
        },
        {
          path: '/smsHistoryFailure',
          name: 'SMSHistoryFailure',
          component: SMSHistoryFailure
        },
        {
          path: '/wxMsgFailure',
          name: 'WxMsgFailure',
          component: WxMsgFailure
        },
        {
          path: '/wanhaoReport',
          name: 'WanhaoReport',
          component: () => import('./views/report/wanhaoReport.vue'),
        },
        {
          path: '/premisesList',
          name: 'PremisesList',
          component: PremisesList
        },
        {
          path: '/dynamicList',
          name: 'DynamicList',
          component: DynamicList
        },
        {
          path: '/commissionList',
          name: 'CommissionList',
          component: () => import('./views/commission/CommissionList.vue'),
        },
      ]
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue'),
    // },
  ],
})
